#include "addlinecmd.h"
#include <Document>
#include <Line>

AddLineCmd::AddLineCmd(Document &doc, QPointer<Line> line)
    : AbstractCmd("Create Line")
    , m_doc(doc)
    , m_line(line)

{
}

void AddLineCmd::undo()
{
    m_doc.removeElement(qobject_cast<Element*>(m_line));
}

void AddLineCmd::redo()
{
    m_doc.addElement(qobject_cast<Element*>(m_line));
}
